/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2010.

	This file is part of Maxsi Client.

	Maxsi Client is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi Client is distributed in the hope that it will be useful, but WITHOUT
	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
	FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
	License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Client. If not, see <http://www.gnu.org/licenses/>.

	Maxsi Client
	A client UI to the digital distribution platform Maxsi Distribution.

	PageInstallerInitializing.cpp
	The page that asks the user what to install and then loads information
	about it.

******************************************************************************/

#include "MaxsiLibrary.h"
#include "UI.h"
#include "PageInstallerInitializing.h"
#include "PageInstallerInstalling.h"

PageInstallerInitializing::PageInstallerInitializing()
{
	Install		=	NULL;
}

PageInstallerInitializing::~PageInstallerInitializing()
{
	
}

MaxsiError PageInstallerInitializing::CreateControls()
{
	Install		=	Window->CreateChild(_MESTR("Button"), 125, 32, Window->Width()-1*150, Window->Height()-60, _MESTR("Install"));
	
	return MAXSI_ERROR_SUCCESS;
}

MaxsiError PageInstallerInitializing::DeleteControls()
{
	WindowSystem->DeleteWindow(Install);

	return MAXSI_ERROR_SUCCESS;
}

MaxsiError PageInstallerInitializing::OnEvent(MaxsiWindowEvent* Event)
{
	if ( Event->Owner == Install && Event->Type == MAXSI_EVENT_PRESSED )
	{
		return SetReplacement(new PageInstalling);
	}

	return MAXSI_ERROR_NOT_SUPPORTED;
}

